package org.csmz.xg2333;

import java.util.ArrayList;
import java.util.List;

public class Example01 {
    public static void main(String[] args){
        List list = new ArrayList();
        list.add("Java");
        list.add("python");
        list.add("c++");
        System.out.println("在集合当中添加三个元素："+list);
        list.add(2,"MATLAB");
        System.out.println("在第三个地方添加MATLAB:"+list);
        list.remove(3);
        System.out.println("删除第四个元素："+list);
        System.out.println("获取第一个元素:"+list.get(0));
        System.out.println("将第三个元素+替换为matlab："+list.set(2,"matlab"));
        System.out.println("替换后的元素为："+list);
        System.out.println("最终元素的个数为："+list.size());
    }
}
